﻿using System;
using System.Data;
using System.Data.Common;
using Hxj.Data;
using Hxj.Data.Common;

namespace RecruitStudents.Utility.Model
{

	/// <summary>
	/// 实体类TB_Sys_User 。(属性说明自动提取数据库字段的描述信息)
	/// </summary>
	[Serializable]
	public class TB_Sys_User : Entity 
	{
		public TB_Sys_User():base("TB_Sys_User") {    _UserID=Guid.NewGuid().ToString();}

        #region Model
        private string _UserID;
        private string _LoginName;
        private string _Name;
        private string _Type;
        private string _Password;
        private string _IsActive;
        private DateTime? _CreateDate;
        private string _RoleID;
        /// <summary>
        /// 用户ID
        /// </summary>
        public string UserID
        {
            get { return _UserID; }
            set
            {
                this.OnPropertyValueChange(_.UserID, _UserID, value);
                this._UserID = value;
            }
        }
        /// <summary>
        /// 登录名
        /// </summary>
        public string LoginName
        {
            get { return _LoginName; }
            set
            {
                this.OnPropertyValueChange(_.LoginName, _LoginName, value);
                this._LoginName = value;
            }
        }
        /// <summary>
        /// 姓名
        /// </summary>
        public string Name
        {
            get { return _Name; }
            set
            {
                this.OnPropertyValueChange(_.Name, _Name, value);
                this._Name = value;
            }
        }
        /// <summary>
        /// 类别(0超级管理员1考务2秘书3招办,4信息录入,5财务)
        /// </summary>
        public string Type
        {
            get { return _Type; }
            set
            {
                this.OnPropertyValueChange(_.Type, _Type, value);
                this._Type = value;
            }
        }
        /// <summary>
        /// 密码
        /// </summary>
        public string Password
        {
            get { return _Password; }
            set
            {
                this.OnPropertyValueChange(_.Password, _Password, value);
                this._Password = value;
            }
        }
        /// <summary>
        /// 是否有效
        /// </summary>
        public string IsActive
        {
            get { return _IsActive; }
            set
            {
                this.OnPropertyValueChange(_.IsActive, _IsActive, value);
                this._IsActive = value;
            }
        }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateDate
        {
            get { return _CreateDate; }
            set
            {
                this.OnPropertyValueChange(_.CreateDate, _CreateDate, value);
                this._CreateDate = value;
            }
        }
        /// <summary>
        /// 角色ID
        /// </summary>
        public string RoleID
        {
            get { return _RoleID; }
            set
            {
                this.OnPropertyValueChange(_.RoleID, _RoleID, value);
                this._RoleID = value;
            }
        }
        #endregion

        #region Method
        /// <summary>
        /// 获取实体中的主键列
        /// </summary>
        public override Field[] GetPrimaryKeyFields()
        {
            return new Field[] {
				_.UserID};
        }
        /// <summary>
        /// 获取列信息
        /// </summary>
        public override Field[] GetFields()
        {
            return new Field[] {
				_.UserID,
				_.LoginName,
				_.Name,
				_.Type,
				_.Password,
				_.IsActive,
				_.CreateDate,
				_.RoleID};
        }
        /// <summary>
        /// 获取值信息
        /// </summary>
        public override object[] GetValues()
        {
            return new object[] {
				this._UserID,
				this._LoginName,
				this._Name,
				this._Type,
				this._Password,
				this._IsActive,
				this._CreateDate,
				this._RoleID};
        }
        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        public override void SetPropertyValues(IDataReader reader)
        {
            this._UserID = DataUtils.ConvertValue<string>(reader["UserID"]);
            this._LoginName = DataUtils.ConvertValue<string>(reader["LoginName"]);
            this._Name = DataUtils.ConvertValue<string>(reader["Name"]);
            this._Type = DataUtils.ConvertValue<string>(reader["Type"]);
            this._Password = DataUtils.ConvertValue<string>(reader["Password"]);
            this._IsActive = DataUtils.ConvertValue<string>(reader["IsActive"]);
            this._CreateDate = DataUtils.ConvertValue<DateTime?>(reader["CreateDate"]);
            this._RoleID = DataUtils.ConvertValue<string>(reader["RoleID"]);
        }
        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        public override void SetPropertyValues(DataRow row)
        {
            this._UserID = DataUtils.ConvertValue<string>(row["UserID"]);
            this._LoginName = DataUtils.ConvertValue<string>(row["LoginName"]);
            this._Name = DataUtils.ConvertValue<string>(row["Name"]);
            this._Type = DataUtils.ConvertValue<string>(row["Type"]);
            this._Password = DataUtils.ConvertValue<string>(row["Password"]);
            this._IsActive = DataUtils.ConvertValue<string>(row["IsActive"]);
            this._CreateDate = DataUtils.ConvertValue<DateTime?>(row["CreateDate"]);
            this._RoleID = DataUtils.ConvertValue<string>(row["RoleID"]);
        }
        #endregion

        #region _Field
        /// <summary>
        /// 字段信息
        /// </summary>
        public class _
        {
            /// <summary>
            /// * 
            /// </summary>
            public readonly static Field All = new Field("*", "TB_Sys_User");
            /// <summary>
            /// 用户ID
            /// </summary>
            public readonly static Field UserID = new Field("UserID", "TB_Sys_User", "用户ID");
            /// <summary>
            /// 登录名
            /// </summary>
            public readonly static Field LoginName = new Field("LoginName", "TB_Sys_User", "登录名");
            /// <summary>
            /// 姓名
            /// </summary>
            public readonly static Field Name = new Field("Name", "TB_Sys_User", "姓名");
            /// <summary>
            /// 类别(0超级管理员1考务2秘书3招办,4信息录入,5财务)
            /// </summary>
            public readonly static Field Type = new Field("Type", "TB_Sys_User", "类别(0超级管理员1考务2秘书3招办,4信息录入,5财务)");
            /// <summary>
            /// 密码
            /// </summary>
            public readonly static Field Password = new Field("Password", "TB_Sys_User", "密码");
            /// <summary>
            /// 是否有效
            /// </summary>
            public readonly static Field IsActive = new Field("IsActive", "TB_Sys_User", "是否有效");
            /// <summary>
            /// 创建时间
            /// </summary>
            public readonly static Field CreateDate = new Field("CreateDate", "TB_Sys_User", "创建时间");
            /// <summary>
            /// 角色ID
            /// </summary>
            public readonly static Field RoleID = new Field("RoleID", "TB_Sys_User", "角色ID");
        }
        #endregion


    }
}


